<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>计算属性</title>
</head>
<body>
<div id="app">
  <div>
    <!-- 方法是带括号的 -->
    currentTime1:<p>{{currentTime1()}}</p>
  </div>
  <p></p>
  <div>
    <!-- 属性是不带括号的 -->
    currentTime2:<p>{{currentTime2}}</p>
  </div>
</div>


<!-- 导入vue的包-->
<script src="https://cdn.jsdelivr.net/npm/vue@2.5.21/dist/vue.min.js"></script>
<script>
  var vm = new Vue({
    el: "#app",
    data: {
      message: "test"
    },
    methods: {
      currentTime1: function (){
        this.message;
        return Date.now();
      }
    },
    computed: {
      currentTime2: function (){
        return Date.now();
      }
    }
  })
</script>
</body>
</html>